package com.liu.io.file.excel.write;

import com.liu.io.file.excel.poi.HSSFWorkbookUtil;
import com.liu.io.file.excel.poi.XSSFWorkbookUtil;
import jxl.read.biff.BiffException;
import java.io.IOException;
import java.util.Map;

/**
 * 生成EXCLE
 * @author liubo
 */
public class ExcelWrite {
    /**
     * 生成EXCLE
     * @param data
     * @param name
     * @throws BiffException
     * @throws IOException
     */
    public void writeExcel(Map<String, Object> data, String name) throws BiffException, IOException {
        if (name.endsWith("xls")) {
            new HSSFWorkbookUtil().writeXls(data, name);
        } else if (name.endsWith("xlsx")) {
            new XSSFWorkbookUtil().writeXlsx(data, name);
        } else if (name.endsWith("csv")) {
//            data = new CSVUtil().writeCsv(file, sheets);
        } else {

        }
    }

}